<?php
/**
 * Created by PhpStorm.
 * User: lxq
 * Date: 2018/4/18
 * Time: 17:42
 */
class order_goodsModel extends  Model{

    public function __construct()
    {
        parent::__construct('order_goods');
    }

    /**
     * 获取记录数组
     * @param array $condition
     * @param string $field
     * @param string $order
     * @return mixed
     */
    public function getOrderGoodsList($condition = array(), $field = '*', $order = 'og_time desc'){
        return $this->field($field)->where($condition)->order($order)->select();
    }

    /**
     * 更新记录
     * @param array $condition
     * @param array $params
     * @return mixed
     */
    public function updateOrderGoods($condition, $params)
    {
        return $this->where($condition)->update($params);
    }

    /**
     * 插入一条记录
     * @param array $params
     * @return mixed
     */
    public function addOrderGoods($params)
    {
        return $this->insert($params);
    }


    /**
     * 获取一条记录的详细信息
     * @param array $condition
     * @param string $field
     * @return mixed
     */
    public function getOrderGoodsInfo($condition = array(), $field = '*')
    {
        return $this->field($field)->where($condition)->find();
    }


}